def isAbbreviation(words, s):
    i = 0  # words数组的索引
    j = 0  # s的索引

    while i < len(words) and j < len(s):
        if words[i][0] == s[j]:
            j += 1
        i += 1

    return j == len(s)

# 测试样例
words = ["apple", "banana"]
s = "ab"
print(isAbbreviation(words, s))

words = ["bear", "aardvark"]
s = "ab"
print(isAbbreviation(words, s))